package com.qingyouchuxing.mall.biz.convert;

import com.qingyouchuxing.mall.biz.domain.bo.MallGoodsSkuBO;
import com.qingyouchuxing.mall.biz.domain.entity.MallGoodsSku;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface MallGoodsSkuConvert {
    MallGoodsSkuConvert INSTANCES = Mappers.getMapper(MallGoodsSkuConvert.class);

    @Mapping(target = "updateTime", ignore = true)
    @Mapping(target = "updateBy", ignore = true)
    @Mapping(target = "searchValue", ignore = true)
    @Mapping(target = "params", ignore = true)
    @Mapping(target = "id", source = "skuId")
    @Mapping(target = "fkTenantId", ignore = true)
    @Mapping(target = "createTime", ignore = true)
    @Mapping(target = "createBy", ignore = true)
    MallGoodsSku boToEntity(MallGoodsSkuBO bo);

    List<MallGoodsSku> boToEntity(List<MallGoodsSkuBO> bo);


    @Mapping(target = "skuId", source = "id")
    MallGoodsSkuBO entityToBO(MallGoodsSku entity);

    List<MallGoodsSkuBO> entityToBO(List<MallGoodsSku> entity);
}
